<template>
	<div class="header">
		<textarea cols="105" rows="4" v-model="desc" placeholder="请输入BUG的描述信息"></textarea>
		<br>
		<button class="small green button" @click="save">保存</button>
	</div>
</template>

<script>
	export default{
		name:'BugHeader',
		data(){
		    return{
                desc:'',

			}
		},
		methods:{
		    save(){

				//获取desc
				//创建bug对象
				let bug = {
		            id:Date.now(),
					desc:this.desc,
					resolved:false
		        }
                console.log(bug)
				//添加到bugList里面
                this.saveBugCallback(bug)
				//清空文本域
				this.desc = ''
			}
		},
        props:['saveBugCallback']
	}
</script>

<style scoped>
</style>